import React, { useEffect, useState } from 'react'
import { Switch, Route, Redirect, Redirect } from 'react-router-dom'
import Home from '../../../src/views/Home/index'
import NotPermission from '../../views/NotPermission/index'
export default function index() {
    const [routerList, setRouterList] = useState([])
    const localRouterMap = [
        {
            key:'/home',
            components:Home
        }
    ]
    return (
        <div>
            <Switch>
                {
                    localRouterMap.map(item => {
                        return <Route
                            path={item.key}
                            key={item.key}
                            component={item.components}
                            exact
                        ></Route>
                    })
                }
                <Redirect from="/" to="/home" exact></Redirect>
                <Route path="*" component={NotPermission}></Route>
            </Switch>
        </div>
    )
}
